package com.cn.pet.data;


import java.util.Map;
import java.util.TreeMap;

public enum Platform {

    TAO_BAO(1,"淘宝"),
    JING_DONG(2,"京东"),
    PIN_DUO_DUO(3,"拼多多");

    Integer code;
    String name;

    Platform(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static Map<Integer,String> getPlatforms(){
        Map<Integer,String> map = new TreeMap<Integer,String>();
        for (Platform platform : Platform.values()) {
            map.put(platform.getCode(),platform.getName());
        }
        return map;
    }
}
